<td class="simple_td" style="border:none;">
    <a href="index.php">Home</a>
</td>
<?
	$CurrentMenuNumber = 1;
    $categories = new CategoryBO();
	$categories->menuNumber = $CurrentMenuNumber;
    $categories_lang = new CategoryLangBO();
    $categories_lang->langID = CURRENT_LANGUAGE_ID;
    $categories->leftJoin($categories_lang);
    $count = $categories->getCount();
    $categories->Load(0,0,array($categories->fields["position"] => "0"));
    $current = 0;
    $has_url = false;
    while($categories->Next()) {
    	$has_url = ($categories->pageID>0 || strlen(trim($categories->caturl))>0);
  		$URL="";
  		if($has_url) {
    		$URL=($categories->cattype=="0")?("/page.php?id=".$categories->pageID):(url_prepare_to_display($categories->caturl));
                }
		if ($categories->cattype=="2") $URL=HTTP_SERVER."/category.php?id=".url_prepare_to_display($categories->pageID);
		if ($categories->visible != 0) {
			$URL2 = "\"\"";
			$URL = "\"\"";
		} else {
			$URL2 = "\"".$URL."\"";
			$URL = "\"".$URL."\"";
		}

        $menu_selected=GETPOST("id",NULL);
        //var_dump($URL);
if(($categories->pageID==$menu_selected)||(($menu_selected==NULL)&&($categories->caturl=="index.php"))){
?>
    <td  id="center_menu_label" align="center" style="">
        <?=$categories->leftJoined["CategoryLangBO"]->values["catName"]?>
    </td>
    
<?
    }else{
?>
<td class="simple_td" >
    <?="<a href=".$URL."> ".$categories->leftJoined["CategoryLangBO"]->values["catName"]."</a>"?>
</td>
<?
        }
    }
?>


